package com.lc.activiti.sys.controller;


import com.lc.activiti.config.Result;
import com.lc.activiti.sys.entity.SysRole;
import com.lc.activiti.sys.service.SysRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 角色(SysRole)表控制层
 *
 * @author 骆超
 * @since 2021-06-28 14:10:02
 */
@RestController
@RequestMapping("sysRole")
@Api(tags = "角色")
public class SysRoleController {
    /**
     * 服务对象
     */
    @Resource
    private SysRoleService sysRoleService;

    /**
     * 保存或更新角色
     * @author 骆超
     * @date 2021/6/28
     * @param sysRole 参数说明
     * @return com.lc.activiti.config.Result
     */
    @PostMapping("saveRoleInfo")
    @ApiOperation("保存或更新角色")
    public Result saveRoleInfo(@RequestBody SysRole sysRole){
        return sysRoleService.saveRoleInfo(sysRole);
    }


    /**
     * 获取角色列表
     * @author 骆超
     * @date 2021/6/28
     * @param sysRole 参数说明
     * @return com.lc.activiti.config.Result
     */
    @PostMapping("getRoleList")
    @ApiOperation("获取角色列表")
    public Result getRoleList(@RequestBody SysRole sysRole){
        return sysRoleService.getRoleList(sysRole);
    }

}
